package com.jy.service.impl;

import com.jy.entity.CwAdvertising;
import com.jy.entity.PageInfo;
import com.jy.mapper.CwAdvertisingMapper;
import com.jy.service.ICwAdvertisingService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 广告费表 服务实现类
 * </p>
 *
 * @author WeiQuan
 * @since 2022-11-14
 */
@Service
public class CwAdvertisingServiceImpl extends ServiceImpl<CwAdvertisingMapper, CwAdvertising> implements ICwAdvertisingService {

    @Resource
    private CwAdvertisingMapper cw;
//  查询广告费表 分页
    @Override
    public PageInfo allCwAdvertising(PageInfo pageInfo) {
        pageInfo.setTotalRow(cw.selCwAdvertisingcount());//查总页数
        pageInfo.setDatas(cw.allCwAdvertising(pageInfo));//根据开始行和每页行数 查当前页数据
        return pageInfo;
    }
//  添加广告费表数据
    @Override
    public int addCwAdvertisingcount(CwAdvertising cwAdvertising) {
        return cw.addCwAdvertisingcount(cwAdvertising);
    }
//  删除广告费表数据
    @Override
    public int delCwAdvertisingcount(Integer aid) {
        return cw.delCwAdvertisingcount(aid);
    }
//  修改广告费数据
    @Override
    public int upCwAdvertisingcount(CwAdvertising cwAdvertising) {
        return cw.upCwAdvertisingcount(cwAdvertising);
    }
}
